<template>
  <aigc-card >

    <div id="attcktype" class="w-full h-[13vh]"></div>
  </aigc-card>
  <!-- 24小时攻击类型分布（越狱，提示泄露，目标劫持）（饼图） -->
 
</template>

<script setup lang="ts">
import * as echarts from 'echarts'
import { onMounted } from 'vue';
import aigcCard from "@/components/aigcCard"
const option = {
  title:{
    text:"24小时攻击类型分布",
    left:'center'
  },
  tooltip: {
    trigger: 'item'
  },
  // legend: {
  //   orient: 'vertical',
  //   left: 'left'
  // },
  series: [
    { 
      top:25,
      left:0,
      name: '24小时攻击类型分布',
      type: 'pie',
      radius: '99%',
      data: [
        { value: 1048, name: '越狱' },
        { value: 735, name: '提示泄露' },
        { value: 580, name: '目标泄漏' },
        // { value: 484, name: 'Union Ads' },
        // { value: 300, name: 'Video Ads' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};
onMounted(async () => {
  const chartDom = await document.getElementById("attcktype")!;
  const myChart =  await echarts.init(chartDom);
  option && await myChart.setOption(option);
});
</script>